#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
void YangHuiSwap(int arr[][4], int y)
{
	for (int i = 0; i < y; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			if (j== 0 || j == i)
			{
				arr[i][j] = 1;
			}
			else
			{
				arr[i][j] = arr[i - 1][j ] + arr[i - 1][j - 1];
			}
		}
	}
}
int main()
{
	int arr[4][4] = { 0 };
	YangHuiSwap(arr, 4);
	for (int i = 0; i < 4; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			printf("%d ", arr[i][j]);
		}
		printf("\n");
	}
}